
function getTime() {
    var time = new Date();

    var currTime = '';
    currTime += time.getFullYear() + "年";
    currTime += (time.getMonth() + 1) + "月";
    currTime += time.getDate() + "日 ";
    currTime += time.getHours() + "时";
    currTime += time.getMinutes() + "分";
    currTime += time.getSeconds() + "秒";

    document.getElementById("currTime").innerHTML = currTime;

    setTimeout(getTime, 1000);
}

getTime();